package com.systemframework.sys.controller;

import cn.dev33.satoken.annotation.SaIgnore;
import com.systemframework.annotation.LicenseAnnotation;
import com.systemframework.sys.configuration.CaptchaConfiguration;
import com.systemframework.sys.dto.response.CaptchaResponseDTO;
import com.systemframework.util.Result;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author summer
 * @date 2023-04-07 17:43
 */
@RestController
@AllArgsConstructor
public class CaptchaController {


    private final CaptchaConfiguration captchaConfiguration;

    @LicenseAnnotation
    @SaIgnore
    @RequestMapping(value = "/captcha")
    public Result<CaptchaResponseDTO> code(){
          return Result.successResult(captchaConfiguration.captcha());
    }
}
